<template>
  <div class="app-container">
    <el-row :gutter="20">
      <!--部门数据-->
      <el-col :span="4" :xs="24">
        <div class="head-container">
          <el-input
            v-model="stationName"
            placeholder="请输入加注站名称"
            clearable
            size="small"
            prefix-icon="el-icon-search"
            style="margin-bottom: 20px"
          />
        </div>
        <div class="head-container">
          <el-tree
            :data="filteredData"
            :props="defaultProps"
            :expand-on-click-node="false"
            ref="tree"
            node-key="stationId"
            default-expand-all
            highlight-current
            @node-click="handleNodeClick"
          />
        </div>
      </el-col>
      <el-col :span="20" :xs="24">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
                 label-width="68px">
          <el-form-item label="加注员姓名" prop="stationUsername">
            <el-input
              v-model="queryParams.stationUsername"
              placeholder="请输入加注站加注员姓名"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="加注站电话" prop="stationPhone">
            <el-input
              v-model="queryParams.stationPhone"
              placeholder="请输入加注站电话"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="模式" prop="stationState">
            <el-select
              v-model="queryParams.stationState"
              placeholder="加注站模式"
              clearable
              style="width: 240px"
            >
              <el-option
                v-for="dict in dict.type.c_station_pattern"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>

          <el-form-item label="加注站名" prop="stationName">
            <el-input
              v-model="queryParams.stationName"
              placeholder="请输入加注站名"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          <el-form-item label="省市区">
            <el-cascader v-model="queryParams.stationArea" :options="provinceOptions" @change="SeachLocationChange"
                         prop="stationArea" placeholder="请选择区县"/>
          </el-form-item>

          <el-form-item label="加注站地址" prop="stationPlace">
            <el-input v-model="queryParams.stationPlace"
                      placeholder="请输入加注站地址"
                      clearable
                      @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="状态" prop="stationUse">
            <el-select
              v-model="form.stationUse"
              placeholder="加注站状态"
              clearable
              style="width: 240px"
            >
              <el-option
                v-for="dict in dict.type.c_station_state"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>

          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>

        </el-form>

        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button
              type="primary"
              plain
              icon="el-icon-plus"
              size="mini"
              @click="handleAdd"
              v-hasPermi="['consumer:station:add']"
            >新增加注站
            </el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="success"
              plain
              icon="el-icon-edit"
              size="mini"
              :disabled="single"
              @click="handleUpdate"
              v-hasPermi="['consumer:station:edit']"
            >修改
            </el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="danger"
              plain
              icon="el-icon-delete"
              size="mini"
              :disabled="multiple"
              @click="handleDelete"
              v-hasPermi="['consumer:station:remove']"
            >删除
            </el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="warning"
              plain
              icon="el-icon-download"
              size="mini"
              @click="handleExport"
              v-hasPermi="['consumer:station:export']"
            >导出
            </el-button>
          </el-col>
          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>
        <el-table border v-loading="loading" :data="filteredStationList" @selection-change="handleSelectionChange">
          <el-table-column label="加注员姓名" align="center" prop="stationUsername"/>
          <el-table-column label="加注站图片" align="center" prop="stationImg" width="100">
            <template slot-scope="scope">
              <image-preview :src="scope.row.stationImg" :width="50" :height="50"/>
            </template>
          </el-table-column>
          <el-table-column label="加注站电话" align="center" prop="stationPhone"/>
          <el-table-column label="加注站模式" align="center" prop="stationState">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.c_station_pattern" :value="scope.row.stationState"/>
            </template>
          </el-table-column>
          <!--      <el-table-column label="经度" align="center" prop="stationLatitude" />-->
          <!--      <el-table-column label="纬度" align="center" prop="stationLongitude" />-->
          <el-table-column label="加注站名" align="center" prop="stationName"/>
          <el-table-column label="加注站地址" align="center" prop="stationPlace"/>
          <el-table-column label="所属省" align="center" prop="stationProvince"/>
          <el-table-column label="所属市" align="center" prop="stationCity"/>
          <el-table-column label="所属区县" align="center" prop="stationArea"/>
          <el-table-column label="状态" align="center" prop="status">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.c_station_state" :value="scope.row.stationUse"/>
            </template>
          </el-table-column>
          <!--      <el-table-column label="是否删除" align="center" prop="isDelete" />-->
          <!--      <el-table-column label="状态，0：正常，1：禁用" align="center" prop="status" />-->
          <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handleUpdate(scope.row)"
                v-hasPermi="['consumer:station:edit']"
              >修改
              </el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-delete"
                @click="handleDelete(scope.row)"
                v-hasPermi="['consumer:station:remove']"
              >删除
              </el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-divider class="table-divider"></el-divider>

        <Facilit v-if="selectedStationId!=null" :exampleProp="selectedStationId"></Facilit>
      </el-col>
    </el-row>


    <!-- 添加或修改加注站对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="搜索绑定加注员" prop="fillerId">
          <el-form v-if="form.fillerId===null" :model="FqueryParams" ref="FqueryForm" size="small" :inline="true"
                   v-show="showSearch"
                   label-width="68px">
            <el-form-item label="手机号码" prop="userPhone">
              <el-input
                v-model="FqueryParams.userPhone"
                placeholder="请输入用户手机号"
                clearable
                @keyup.enter.native="FhandleQuery"
              />
            </el-form-item>
            <el-form-item label="微信昵称" prop="userNick">
              <el-input
                v-model="FqueryParams.userNick"
                placeholder="请输入用户微信昵称"
                clearable
                @keyup.enter.native="FhandleQuery"
              />
            </el-form-item>
            <el-form-item label="用户姓名" prop="userName">
              <el-input
                v-model="FqueryParams.userName"
                placeholder="请输入用户姓名"
                clearable
                @keyup.enter.native="FhandleQuery"
              />
            </el-form-item>

            <el-form-item>
              <el-button type="primary" icon="el-icon-search" size="mini" @click="FhandleQuery">搜索</el-button>
              <el-button icon="el-icon-refresh" size="mini" @click="FresetQuery">重置</el-button>
            </el-form-item>
          </el-form>

          <el-table v-if="form.fillerId===null" v-loading="loading" :data="fuserList"
                    @selection-change="handleSelectionChange">
            <el-table-column label="手机号码" align="center" prop="userPhone"/>
            <el-table-column label="微信昵称" align="center" prop="userNick"/>
            <el-table-column label="微信头像" align="center" prop="userHeader" width="100">
              <template slot-scope="scope">
                <image-preview :src="scope.row.userHeader" :width="50" :height="50"/>
              </template>
            </el-table-column>
            <el-table-column label="用户姓名" align="center" prop="userName"/>
            <!--      <el-table-column label="是否删除" align="center" prop="isDelete" />-->
            <!--      <el-table-column label="状态，0：正常，1：禁用" align="center" prop="status" />-->
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-plus"
                  @click="bindFuser(scope.row)"
                >绑定
                </el-button>
              </template>
            </el-table-column>
          </el-table>

          <el-table :show-header="false" v-if="form.fillerId!=null" v-loading="loading" :data="fuserList"
                    @selection-change="handleSelectionChange">
            <el-table-column align="center" prop="userPhone"/>
            <el-table-column align="center" prop="userNick"/>
            <el-table-column align="center" prop="userHeader" width="100">
              <template slot-scope="scope">
                <image-preview :src="scope.row.userHeader" :width="50" :height="50"/>
              </template>
            </el-table-column>
            <el-table-column align="center" prop="userName"/>
            <el-table-column align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-remove"
                  @click="canclebindFuser(scope.row)"
                >取消绑定
                </el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-form-item>
        <el-form-item label="加注员姓名" prop="stationUsername">
          <el-input v-model="form.stationUsername" placeholder="请输入加注站加注员姓名"/>
        </el-form-item>
        <el-form-item label="加注站图片" prop="stationImg">
          <image-upload v-model="form.stationImg"/>
        </el-form-item>
        <el-form-item label="加注站电话" prop="stationPhone">
          <el-input v-model="form.stationPhone" placeholder="请输入加注站电话"/>
        </el-form-item>
        <el-form-item label="模式" prop="stationState">
          <el-select
            v-model="form.stationState"
            placeholder="加注站模式"
            clearable
            style="width: 240px"
          >
            <el-option
              v-for="dict in dict.type.c_station_pattern"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>

        <el-form-item label="加注站名" prop="stationName">
          <el-input v-model="form.stationName" placeholder="请输入加注站名"/>
        </el-form-item>
        <el-form-item label="加注站地址">
          <!-- 当form.address有值时显示form.stationPlace，否则显示mainForm.address-->
          <el-input placeholder="请选择地址" v-model="form.stationPlace || mainForm.address" readonly>
            <el-button slot="append" icon="el-icon-location" @click="openMap()"></el-button>
          </el-input>
          <MapSelect ref="ms" @on-select="selectAddress"/>

        </el-form-item>
        <el-form-item label="经度" prop="stationLatitude">
          <el-input v-model="form.stationLatitude" disabled placeholder="地图选点后自动获取"/>
        </el-form-item>
        <el-form-item label="纬度" prop="stationLongitude">
          <el-input v-model="form.stationLongitude" disabled placeholder="地图选点后自动获取"/>
        </el-form-item>

        <el-form-item label="省市区">
          <el-cascader v-model="form.stationArea" :options="provinceOptions" @change="handleLocationChange"
                       placeholder="请选择区县"/>
        </el-form-item>
        <!--        <el-form-item label="0为空闲，1为使用" prop="stationUse">-->
        <!--          <el-input v-model="form.stationUse" placeholder="请输入0为空闲，1为使用" />-->
        <!--        </el-form-item>-->
        <el-form-item label="状态" prop="stationUse">
          <el-select
            v-model="form.stationUse"
            placeholder="加注站状态"
            clearable
            style="width: 240px"
          >
            <el-option
              v-for="dict in dict.type.c_station_state"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {listStation, getStation, delStation, addStation, updateStation} from "@/api/consumer/station";
import {listFuser, getFuser} from "@/api/consumer/fuser";
import {SelectFuserId} from "@/api/consumer/admin/station";
import dict from "@/utils/dict";
import Facilit from "@/views/consumer/facilit/index";
import provinceData from '@/store/data';
import MapSelect from '@/views/components/MapSelect';

console.log("地区数据；" + provinceData);
export default {
  name: "Station",
  dicts: ['c_station_state', 'c_station_pattern'],
  components: {
    Facilit,
    MapSelect
  },
  computed: {
    filteredStationList() {
      if (this.selectedStationId === null) {
        // 如果没有选中的stationId，则返回空数组
        return [];
      } else {
        // 使用过滤条件来过滤数据
        return this.stationList.filter((item) => item.stationId === this.selectedStationId);
      }

    },
    // 根据deptName过滤数据
    filteredData() {
      const keyword = this.stationName.trim().toLowerCase(); // 获取搜索关键字并去除首尾空格并转为小写
      if (!keyword) {
        // 如果关键字为空，返回原始数据
        return this.stationTreeData;
      }

      // 使用过滤条件来过滤数据
      const filteredData = [];
      this.stationTreeData.forEach((group) => {
        const children = group.children.filter((item) => {
          // 过滤条件：如果stationName包含关键字，则保留
          return item.label.toLowerCase().includes(keyword);
        });
        if (children.length > 0) {
          filteredData.push({...group, children});
        }
      });
      return filteredData;
    },
    // 根据stationName分组数据
    stationTreeData() {
      const groupedData = {};
      this.stationList.forEach((item) => {
        const stationName = item.stationName;
        if (!groupedData[stationName]) {
          groupedData[stationName] = [];
        }
        groupedData[stationName].push({
          label: item.stationName,
          stationId: item.stationId,
          // 其他属性...
        });
      });

      // 将分组后的数据转换成树状结构
      const treeData = [];
      for (const stationName in groupedData) {
        treeData.push({
          label: stationName,
          children: groupedData[stationName],
        });
      }

      return treeData;
    },
  },
  data() {
    return {
      defaultProps: {
        children: 'stationName',
        label: 'label'
      },
      stationName: '', // 输入框的值
      selectedStationId: null, // 用于存储当前选中的加注站的stationId
      //地图选点参数
      mainForm: {
        address: '',
        lat: '',
        lng: '',
      },
      // 地区数据
      provinceOptions: provinceData.map(item => ({
        value: item.name,
        label: item.name,
        children: item.city.map(city => ({
          value: city.name,
          label: city.name,
          children: city.area.map(area => ({
            value: area,
            label: area,
          })),
        })),
      })),
      //省数据
      provinceData1: [],
      //市数据
      cityData: [],
      //区数据
      areaData: [],

      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 加注站表格数据
      stationList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 100,
        carId: null,
        fillerId: null,
        stationUsername: null,
        stationImg: [],
        stationPhone: null,
        stationState: null,
        stationLatitude: null,
        stationLongitude: null,
        stationName: null,
        stationPlace: null,
        stationProvince: null,
        stationCity: null,
        stationArea: null,
        stationUse: null,
        isDelete: null,
        status: null
      },
      // 表单参数
      form: {
        stationId: null,
        carId: null,
        fillerId: null,
        stationUsername: null,
        stationImg: null,
        stationPhone: null,
        stationState: null,
        stationLatitude: null,
        stationLongitude: null,
        stationName: null,
        stationPlace: null,
        stationProvince: null,
        stationCity: null,
        stationArea: null,
        stationUse: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        isDelete: null,
        status: null
      },
      // 表单校验
      rules: {
        fillerId: [
          {required: true, message: "加注员不能为空", trigger: "change"}
        ],
        stationUsername: [
          {required: true, message: "加注站用户名不能为空", trigger: "blur"}
        ],
        stationState: [
          {required: true, message: "加注站状态不能为空", trigger: "change"}
        ],
        stationPlace: [
          {required: true, message: "加注站详细地址不能为空", trigger: "blur"}
        ],
        status: [
          {required: true, message: "状态不能为空", trigger: "change"}
        ],
        stationName: [
          {required: true, message: "加注站名不能为空", trigger: "blur"}
        ],
        stationPhone: [
          {required: true, message: "加注站电话不能为空", trigger: "blur"}
        ],
        stationImg: [
          {required: true, message: "加注站图片不能为空", trigger: "blur"}
        ]
      },
      // FUser表单数据
      FqueryParams: {
        pageNum: 1,
        pageSize: 10,
        openid: null,
        userPhone: null,
        userNick: null,
        userHeader: null,
        userName: null,
        isDelete: null,
        status: null
      },
      // f用户账号表格数据
      fuserList: [],
    };
  },
  created() {
    this.getList();
  },


  methods: {
    dict,
    handleNodeClick(node) {
      const stationId = node.children[0].stationId;
      console.log("node", stationId); // 正确输出stationId

      // 更新selectedStationId的值
      this.selectedStationId = stationId;
    },

    // 打开地图弹窗
    openMap() {
      this.$refs.ms.show();
      // 根据省市区设置初始值
      // this.$refs.ms.setLocationByAddress(this.mainForm.address);
      // 根据经纬度设置初始值
      this.$refs.ms.setLocationByLatLng(this.mainForm.lat, this.mainForm.lng);
    },

    // 地址选择后的回调函数
    selectAddress(address, lat, lng, addressInfo) {
      console.log("address", addressInfo);
      console.log("地址详情", address, lat, lng);
      this.mainForm.address = address;
      this.mainForm.lat = lat;
      this.mainForm.lng = lng;
      this.form.stationPlace = address;
      // https://apis.map.qq.com/ws/geocoder/v1/?location=39.984154,116.307490&key=[你的key]&get_poi=1
      // 地址逆解析
      this.GeocoderAddress(lat, lng);
    },
    GeocoderAddress(lat, lng) {
      let that = this;
      that.geocoder = new qq.maps.Geocoder({
        complete: function (result) {
          var address = result.detail.addressComponents;
          console.log('成功：' + address.province + address.city + address.district + address.street + address.streetNumber + address.town);
          that.form.stationProvince = address.province;
          that.form.stationCity = address.city;
          that.form.stationArea = address.district;
        }
      });
      that.geocoder.getAddress(new qq.maps.LatLng(lat, lng));
      //这里是反的,卧槽
      that.form.stationLatitude = lng;
      that.form.stationLongitude = lat;
    },

    //绑定FUser
    bindFuser(methead) {
      SelectFuserId(methead.userId).then(response => {
        console.log("绑定FUser", response)
        if (response.msg === "已绑定加注站") {
          this.$modal.msgError("该成员已绑定加注站,请勿重复绑定")
          return;
        } else if (response.msg === "没有绑定") {
          this.$modal.msgSuccess("选择绑定成功")
          //只保留选fuserList中的该成员
          this.fuserList = this.fuserList.filter(item => item.userId === methead.userId);
          this.form.fillerId = methead.userId;
          return;
        }
      });
    },
    canclebindFuser() {
      this.$modal.msgSuccess("取消绑定成功")
      this.FresetQuery();
      this.form.fillerId = null;
    },

    // 搜索FUser列表
    FhandleQuery() {
      this.FqueryParams.pageNum = 1;
      this.loading = true;
      listFuser(this.FqueryParams).then(response => {
        console.log("FUser列表", response);
        this.fuserList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 重置FUser列表
    FresetQuery() {
      this.FqueryParams = {
        pageNum: 1,
        pageSize: 10,
        openid: null,
        userPhone: null,
        userNick: null,
        userHeader: null,
        userName: null,
        isDelete: null,
        status: null
      };
      this.FhandleQuery();
    },

    /** 选择地区 **/
    SeachLocationChange(value) {
      if (value.length > 0) {
        this.queryParams.stationProvince = value[0];
      }
      if (value.length > 1) {
        this.queryParams.stationCity = value[1];
      }
      if (value.length > 2) {
        this.queryParams.stationArea = value[2];
      }
    },
    /** 选择地区*/
    handleLocationChange(value) {
      if (value.length > 0) {
        this.form.stationProvince = value[0];
      }
      if (value.length > 1) {
        this.form.stationCity = value[1];
      }
      if (value.length > 2) {
        this.form.stationArea = value[2];
      }
      console.log("form：" + form);

    }
    ,
    /** 查询加注站列表 */
    getList() {
      this.loading = true;
      listStation(this.queryParams).then(response => {
        this.stationList = response.rows;
        console.log("加注站列表", this.stationList)
        this.total = response.total;
        this.loading = false;
      });
    }
    ,
// 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    }
    ,
// 表单重置
    reset() {
      // this.$refs["FqueryParams"].resetFields();
      this.form = {
        stationId: null,
        carId: null,
        fillerId: null,
        stationUsername: null,
        stationImg: null,
        stationPhone: null,
        stationState: null,
        stationLatitude: null,
        stationLongitude: null,
        stationName: null,
        stationPlace: null,
        stationProvince: null,
        stationCity: null,
        stationArea: null,
        stationUse: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        isDelete: null,
        status: null
      };
      this.handleQuery();
    }
    ,
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    }
    ,
    /** 重置按钮操作 */
    resetQuery() {
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
        carId: null,
        fillerId: null,
        stationUsername: null,
        stationImg: [],
        stationPhone: null,
        stationState: null,
        stationLatitude: null,
        stationLongitude: null,
        stationName: null,
        stationPlace: null,
        stationProvince: null,
        stationCity: null,
        stationArea: null,
        stationUse: null,
        isDelete: null,
        status: null
      };
      this.selectedStationId = null;
      this.handleQuery();
    },
// 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.stationId)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    }
    ,
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.FqueryParams = {
        pageNum: 1,
        pageSize: 10,
        openid: null,
        userPhone: null,
        userNick: null,
        userHeader: null,
        userName: null,
        isDelete: null,
        status: null
      };
      this.form.fillerId = null;
      this.fuserList = [];
      this.open = true;
      this.title = "新增加注站";
    }
    ,
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const stationId = row.stationId || this.ids
      getStation(stationId).then(response => {
        this.form = response.data;
        this.open = true;
        this.getFuserId(this.form.fillerId)
        this.title = "修改加注站";
      });
    },

    //获取指定fuser
    getFuserId(userId) {
      let that = this;
      getFuser(userId).then(response => {
        console.log("FUser", response);
        that.FqueryParams.openid = response.data.openid;
        that.FqueryParams.userPhone = response.data.userPhone;
        that.FhandleQuery();
      });
    },

    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.stationId != null) {
            console.log(this.form);

            updateStation(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addStation(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    }
    ,
    /** 删除按钮操作 */
    handleDelete(row) {
      const stationIds = row.stationId || this.ids;
      this.$modal.confirm('是否确认删除加注站编号为"' + stationIds + '"的数据项？').then(function () {
        return delStation(stationIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      });
    }
    ,
    /** 导出按钮操作 */
    handleExport() {
      this.download('consumer/station/export', {
        ...this.queryParams
      }, `station_${new Date().getTime()}.xlsx`)
    }
  }
}
;
</script>
